﻿Public MustInherit Class UnidadBase

    Protected Const VIDA_BASE = 1
    Protected Const FUERZA_BASE = 3
    Protected Const ATAQUE_BASE = 3
    Protected Const DEFENSA_BASE = 3
    Protected Const DISCIPLINA_BASE = 3
    Protected Const TAMAÑO_BASE = 1
    Protected Const COSTE_BASE = 1
    Protected Const VELOCIDAD_BASE = 1
    'Protected Const DISTANCIA_ATAQUE = 1
    Protected Friend Property Vida As Integer
    Protected Friend Property Fuerza As Integer
    Protected Friend Property Velocidad As Integer
    Protected Friend Property Defensa As Integer
    Protected Friend Property Tamaño As Integer
    Protected Friend Property Ataque As Integer
    Protected Friend Property Disciplina As Integer
    Protected Friend Property Imagen As Image
    Protected Friend Property Coste As Integer
    'Protected Friend Property Distancia As Integer

    Public Sub New()
        Me.Vida = VIDA_BASE
        Me.Fuerza = FUERZA_BASE
        Me.Velocidad = VELOCIDAD_BASE
        Me.Defensa = DEFENSA_BASE
        Me.Tamaño = TAMAÑO_BASE
        Me.Ataque = ATAQUE_BASE
        Me.Disciplina = Disciplina
        Me.Imagen = Imagen
        Me.Coste = COSTE_BASE
        'Me.Distancia = DISTANCIA_ATAQUE
    End Sub

    Public Function Atacar() As Integer
        Dim golpe As Integer
        Dim dado As New Dado
        golpe = dado.lanzar + Me.Ataque
        Return golpe
    End Function

    Public Function Defender() As Integer
        Dim parada As Integer
        Dim dado As New Dado
        parada = dado.lanzar + Me.Defensa
        Return parada
    End Function

    'FUNCIONES SOLO POR SI PODEMOS HACER QUE ATAQUEN Y DEFIENDAN TODOS A LA VEZ
    'Protected Function Atacar(ByVal cantidad As Integer) As List(Of Integer)
    '    Dim resultadoAtaque As List(Of Integer)
    '    Dim dado As New Dado
    '    Dim suma As Integer
    '    For i As Integer = 0 To cantidad
    '        suma = dado.lanzar + Me.Ataque
    '        resultadoAtaque.Add(suma)
    '    Next
    '    Return resultadoAtaque
    'End Function

    'Protected Function Defender(ByVal cantidad As Integer) As List(Of Integer)
    '    Dim resultadoDefensa As List(Of Integer)
    '    Dim dado As New Dado
    '    Dim suma As Integer
    '    For i As Integer = 0 To cantidad
    '        suma = dado.lanzar + Me.Defensa
    '        resultadoDefensa.Add(suma)
    '    Next
    '    Return resultadoDefensa
    'End Function
End Class
